package com.dikang.yygh.controller;

import com.dikang.yygh.common.result.Result;
import com.dikang.yygh.service.DepartmentService;
import com.dikang.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "科室管理接口")
@RequestMapping("/admin/hosp/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    // 查询医院所有科室列表
    @GetMapping("getDeptList/{hosCode}")
    public Result<List<DepartmentVo>> getDepartmentById(@PathVariable String hosCode) {

        return Result.ok(departmentService.selectDepartmentByHoscode(hosCode));
    }
}
